
from rest_framework.generics import CreateAPIView
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework import status
from . import utils,models
from . import serializer

class MobileAPIView(APIView):
	def get(self, request, phone):
		if utils.get_user_by_account(phone):
			return Response({"message": "该手机号已被注册"}, status=status.HTTP_400_BAD_REQUEST)
		return Response({"message": "ok"})

class RegisterView(CreateAPIView):
	queryset = models.User.objects.all()
	serializer_class = serializer.RegisterModelSerializer
